package io;

import java.io.*;

/*
对象流
Object
序列化
 */
public class OOSDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        String name="张三";
        int age=25;
        String gender="男";
        String[] otherInfo={"无非和我已回复以后好好玩以发一会发还好比"};
        Studengt studengt=new Studengt(name,age,gender,otherInfo);
       // System.out.println(studengt);


        /** 对象输出流在序列化对象时，必须保证序列化对象必须实现Serializable接口*/
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(studengt);
        System.out.println("写完");
        oos.close();
    }
}
